package com.bwie.boot.dao;

import org.hibernate.validator.constraints.Mod11Check;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import com.bwie.boot.entity.User;

public interface UserDao extends JpaRepository<User,String>{

	

	User findByLoginname(String loginname);
	
	
	@Modifying
	@Query("update User  u set u.fanscount=u.fanscount+?2 where u.id=?1")
	void incFanscount(String userid, Integer x);
	
	@Modifying
    @Query("update User u set u.followcount=u.followcount+?2 where u.id=?1")
	void incfollow(String userid, Integer x);
   
	
	
}
